package com.hzhjhh.view.manageView.menus.query;


import java.awt.Color;
import java.awt.Frame;
import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.JTableHeader;

import com.hzhjhh.init.dialog.Mytable;
import com.hzhjhh.view.manageView.menus.query.constant.ShowConstants;
import com.hzhjhh.view.manageView.menus.query.saleStatistics.AmtTotal;
import com.hzhjhh.view.manageView.menus.query.saleStatistics.CloseBt;
import com.hzhjhh.view.manageView.menus.query.saleStatistics.MerchandiseCode;
import com.hzhjhh.view.manageView.menus.query.saleStatistics.MerchandiseStatistics;
import com.hzhjhh.view.manageView.menus.query.saleStatistics.QueryBt;
import com.hzhjhh.view.manageView.menus.query.saleStatistics.SaleMerchandiseStatistics;
import com.hzhjhh.view.manageView.menus.query.saleStatistics.StartDate;

import lombok.Getter;
import lombok.Setter;

/**
 * 导航栏初始化-销售管理-销售统计弹出框
 * 
 * @author 12083
 *
 */
@Getter
@Setter
public class SaleStatistics extends JDialog {
    JPanel panel1 = new JPanel();
    JLabel lbTitle ;
    // 开始日期
    JLabel lbStartDate ;
    JComboBox<String> cobStartYear ;
    JLabel lbStartYear ;
    JComboBox<String> cobStartMonth ;
    JLabel lbStartMonth ;
    JComboBox<String> cobStartDay ;
    JLabel lbStartDay;
    // 结束日期
    JLabel lbEndDate;
    JLabel lbAmtTitle;
    JLabel lbAmtShow;
    JComboBox<String> cobEndYear;
    JComboBox<String> cobEndMonth;
    JLabel lbEndYear;
    JLabel lbEndMonnth ;
    JComboBox<String> cobEndDay ;
    JLabel lbEndDay ;
    JLabel lbSaleStatisticsBorder ;
    JButton btQuery = QueryBt.btInit(this);
    JButton btClose = CloseBt.btInit(this);
    JLabel lbMerchandiseStatisticsTitle ;
    JLabel lbLeftGoodsStatistics ;
    JLabel lbSeparatorGoodsStatistics;
    JLabel lbRightGoodsStatistics;


    JTable jTable1 = new JTable();
    JTableHeader jTableHeader1 = jTable1.getTableHeader();


    JScrollPane jScrollPane1 = new JScrollPane();
    JLabel jLabel15 = new JLabel();
    JLabel jLabel16 = new JLabel();
    JTextField txfMerchandiseCode = new JTextField();
    JLabel lbMerchandiseCode = new JLabel();
    private SaleStatistics(Frame owner, String title, boolean modal) {
        super(owner, title, modal);
        try {
            setDefaultCloseOperation(DISPOSE_ON_CLOSE);
            jbInit();
            pack();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    public SaleStatistics() {
        this(new Frame(), "销售统计弹出框", false);
        this.setSize(600,620);
        this.setVisible(true);
        this.setLocation(200, 0);
    }

    private void jbInit() throws Exception {
        panel1.setLayout(null);
        lbTitle = SaleMerchandiseStatistics.lbTitleInit();
        // 起始日期
        lbStartDate = StartDate.lbStartDateInit();
        cobStartYear = StartDate.cobStartYearInit();
        lbStartYear = StartDate.lbStartYearInit();
        cobStartMonth = StartDate.cobStartMonthInit();
        lbStartMonth = StartDate.lbStartMonthInit();
        cobStartDay = StartDate.cobStartDayInit();
        lbStartDay = StartDate.lbStartDayInit();
        // 结束日期
        lbEndDate = StartDate.lbEndDateInit();
        cobEndYear = StartDate.cobEndYearInit();
        lbEndYear = StartDate.lbEndYearInit();
        cobEndMonth = StartDate.cobEndMonthInit();
        lbEndMonnth = StartDate.lbEndMonthInit();
        cobEndDay = StartDate.cobEndDayInit();
        lbEndDay = StartDate.lbEndDayInit();
        
        jScrollPane1.setBounds(14, 203, 568, 308);
        txfMerchandiseCode = MerchandiseCode.txfInit();
        lbMerchandiseCode = MerchandiseCode.lbInit();
        lbSaleStatisticsBorder = SaleMerchandiseStatistics.lbBorderInit();
        
        // 商品综合统计
        lbMerchandiseStatisticsTitle = MerchandiseStatistics.lbInit();
        lbLeftGoodsStatistics = MerchandiseStatistics.lbLeftInit();
        lbSeparatorGoodsStatistics = MerchandiseStatistics.lbSeparateInit();
        lbRightGoodsStatistics = MerchandiseStatistics.lbRightInit();
        // 金额总计
        lbAmtTitle = AmtTotal.amtTitleInit();
        lbAmtShow = AmtTotal.amtShowInit();
        
        panel1.setBackground(Color.pink);
        getContentPane().add(panel1);
        panel1.add(lbTitle);
        // 开始日期
        panel1.add(lbStartDate);
        panel1.add(lbStartYear);
        panel1.add(lbStartMonth);
        panel1.add(lbStartDay);
        panel1.add(cobStartYear);
        panel1.add(cobStartMonth);
        panel1.add(cobStartDay);
        // 结束日期
        panel1.add(lbEndDate);
        panel1.add(lbEndYear);
        panel1.add(lbEndMonnth);
        panel1.add(lbEndDay);
        panel1.add(cobEndYear);
        panel1.add(cobEndMonth);
        panel1.add(cobEndDay);
        panel1.add(btQuery);
        panel1.add(btClose);
        panel1.add(jScrollPane1);
        panel1.add(txfMerchandiseCode);
        panel1.add(lbMerchandiseCode);
        panel1.add(lbSaleStatisticsBorder);
        panel1.add(lbMerchandiseStatisticsTitle);
        panel1.add(lbLeftGoodsStatistics);
        panel1.add(lbSeparatorGoodsStatistics);
        panel1.add(lbRightGoodsStatistics);
        panel1.add(lbAmtTitle);
        panel1.add(lbAmtShow);

        jTable1 = Mytable.maketable(new Vector<>(), ShowConstants.SALE_STATISTICS_HEAD_NAME); //显示内容
        jScrollPane1.getViewport().add(jTable1);//把表装入容器
    }

}


